<?php
/**
 * Created by PhpStorm.
 * User: wanglong
 * Date: 2017/12/22
 * Time: 21:46
 */

namespace app\common\services;

//只用于加载应用本身的资源文件
class StaticServices
{
    public static function includeAppJsStatic($path,$depend)
    {
        self::includeAppStatic("js",$path,$depend);
    }

    public static function includeAppCssStatic($path,$depend)
    {
        self::includeAppStatic("css",$path,$depend);
    }

    protected static function includeAppStatic($type,$path,$depend)
    {
        if($type=="js"){
            \Yii::$app->getView()->registerJsFile($path,['depends'=>$depend]);
        }else{
            \Yii::$app->getView()->registerCssFile($path,['depends'=>$depend]);
        }
    }
}